import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutation'
import actions from './action'
import getters from './getters'
import { getToken } from '@/utils/token'
Vue.use(Vuex)

const state = {
  login: getToken() !== 'undefined' && getToken() !== undefined && getToken() != null && getToken() !== '', // 是否登录
  token: getToken(),
  active: 0 // tabBar索引
}

export default new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})
